import java.util.UUID;

public class Ticket {
    private String ticketId;
    private Schedule schedule;
    private int row;
    private int col;
    private double price;
    private boolean isRefund;

    public Ticket(Schedule schedule, int row, int col) {
        this.ticketId = UUID.randomUUID().toString();
        this.schedule = schedule;
        this.row = row;
        this.col = col;
        this.price = schedule.getPrice();
        this.isRefund = false;
    }

    public String getTicketId() { return ticketId; }

    public Schedule getSchedule() { return schedule; }

    public int getRow() { return row; }

    public int getCol() { return col; }

    public double getPrice() { return price; }

    public boolean isRefund() { return isRefund; }

    public void refund() {
        this.isRefund = true;
    }

    @Override
    public String toString() {
        return "电影票：" + ticketId + "  -  片名：" + schedule.getMovie().getTitle()
                + "  场次时间：" + schedule.getStartTime()
                + "  座位：" + row + "排" + col + "座  价格：" + price;
    }
}